#ifndef __SERVER_H__
#define __SERVER_H__

#include <soar.h>

__BEGIN_DECLS

/*----- 共享信息 -----*/
struct share_info
{/*{{{*/
    char server[NAME_SIZE+1];
    char user[NAME_SIZE+1];
    struct
    {
        char location[LONG_FILE_NM_SIZE+1];
        unsigned int tracking;
    } _errlog_;
    struct
    {
        unsigned int server_port;
        unsigned int monitor_port;
    } _access_;
    struct
    {
        char location[LONG_FILE_NM_SIZE+1];
    } _customlog_;
};/*}}}*/
extern struct share_info *share_info;

/*----- monitor -----*/
#define MONITOR_IDLE_TIMEOUT    SECOND_OF_MINUTE(5) /* 监控闲置超时 */
struct monitor_ctl
{/*{{{*/
    SKT skt;
    char *msg_in;
    char *msg_out;
};/*}}}*/
extern int thrd_monitor(struct monitor_ctl *monitor_ctl);

/*----- worker -----*/
struct worker_ctl
{/*{{{*/
    unsigned long thrd_id;
    SOCKET sock;
    char *msg_in;
    char *msg_out;
};/*}}}*/
extern int thrd_worker(struct worker_ctl *worker_ctl);

/*----- 对外服务 -----*/

__END_DECLS

#endif
